import * as monaco from 'monaco-editor'

import { MagicThemeEnum } from '@/components/MagicEditor/src/shared/themes/theme'
// 假设 ThemeType 是 defaultTheme 的类型
export const Themes = {}

export const defineTheme = (name, options) => {
  options = options || {}
  const editor: monaco.editor.IStandaloneThemeData = options.editor || {}
  editor.base = editor.base || MagicThemeEnum.Vs
  editor.inherit = editor.inherit === undefined ? true : editor.inherit
  editor.rules = editor.rules || []
  editor.colors = editor.colors || []
  monaco.editor.defineTheme(name, editor)
  Themes[name] = options.styles || {}
}
// 定义脚本项接口
export interface ScriptItem {
  id?: string
  tmp_id?: string
  name?: string
  content?: string
  modified?: boolean
  ext?: {
    decorations?: any[]
    [key: string]: any
  }
  [key: string]: any
}
